//  This product includes software developed by Denim Group, Ltd. (http://www.denimgroup.com/)
//  All use and distribution of the Denim Group developed software is subject to Version 2.0
//  of the Apache License (http://www.apache.org/licenses/LICENSE-2.0).

using System;
using System.Collections.Generic;
using System.Text;
using AppScan;
using AppScan.Extensions;

namespace AppScan.DefectLogger
{
    class DefectLoggerTFS : DefectLoggerBase, IExtensionLogic
    {
        #region Members
        private string _regDefectLoggerExtension = "DefectLoggerTFS";
		private string _regXmlConfig = "XmlConfig";
		private IDefectTrackingSystem _defectTrackingSystem = new TFS();
		private string _extensionMenuText = "Log Defect Settings for Team Foundation Server";
		private string _contextMenuText = "Log Defect to Team Foundation Server";        
        #endregion
		#region Properties	
		public override IDefectTrackingSystem DefectTrackingSystem
		{
			get{ return _defectTrackingSystem; }
		}
		protected override string RegDefectLogger
		{
			get { return _regDefectLoggerExtension; }
		}
		protected override string RegXmlConfig
		{
			get{ return _regXmlConfig;}
		}
		protected override ConnectionForm ConnForm
		{
			get { return new ConnectionForm(); }
		}
		protected override string ContextMenuText
		{
			get { return _contextMenuText; }
		}
		protected override string ExtensionMenuText
		{
			get { return _extensionMenuText; }
		}
		#endregion Properties

		/// <summary>
		/// CTor
		/// </summary>
		/// <param name="regKeyName">shortname for registry key for extension registry storage</param>
		/// <param name="regValueName">name for string value</param>
        public DefectLoggerTFS():base()
		{
		}

        #region IExtensionLogic Members

        /// <summary>
        /// retrieves data about current available ext-version
        /// </summary>
        /// <param name="targetApp">app this extension is designated for</param>
        /// <param name="targetAppVersion">current version of targetApp</param>
        /// <returns>update data of most recent extension version, or null if no data was found, or feature isn't supported. it is valid to return update data of current version. extension-update will take place only if returned value indicaes a newer version</returns>
        new public ExtensionVersionInfo GetUpdateData(Edition targetApp, System.Version targetAppVersion)
        {
            return base.GetUpdateData(targetApp, targetAppVersion);
        }

        /// <summary>
        /// extension initialization. typically called on AppScan's startup
        /// </summary>
        /// <param name="appScan">main application object the extension is loaded into</param>
        /// <param name="extensionDir">extension's working directory</param>
        new public void Load(IAppScan appscan, IAppScanGui appScanGui, string extensionDir)
        {
            base.Load(appscan, appScanGui, extensionDir);
        }

        #endregion
    }
}
